/*
 * Copyright (c) 2016. For Intelligent Group.
 */

package com.intelligent.ispc.client.core.view;

import com.intelligent.ispc.client.core.view.global.MainContentPanel;
import com.intelligent.ispc.client.core.view.global.MainStateBar;
import com.intelligent.ispc.client.core.view.global.MainTopToolBar;
import com.intelligent.ispc.client.utils.GBC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.swing.*;
import java.awt.*;

/**
 * Created by Peter on 2016/7/6.
 */
@Component
public class MainPanel extends JPanel {

    @Autowired
    private MainStateBar mainStateBar;

    @Autowired
    private MainContentPanel mainContentPanel;

    @Autowired
    private MainTopToolBar mainTopToolBar;

    /**
     * Constructor
     */
    public MainPanel() {
    }

    /**
     * Initialize components
     */
    @PostConstruct
    public void initComponents() {
        final Dimension mainDialogSize = new Dimension(1000, 618);
        this.setPreferredSize(mainDialogSize);

        GridBagLayout layout = new GridBagLayout();
        this.setLayout(layout);

        this.add(mainTopToolBar, new GBC(0, 0).setFill(GBC.HORIZONTAL).setIpad(0, 0).setWeight(100, 0));
        this.add(mainContentPanel, new GBC(0, 1).setFill(GBC.BOTH).setWeight(100, 100));

        JSeparator jSeparator1 = new JSeparator();
        jSeparator1.setOrientation(SwingConstants.VERTICAL);
        final Color jSeparatorlColor = new java.awt.Color(255, 51, 102);
        jSeparator1.setBackground(jSeparatorlColor);

        this.add(mainStateBar, new GBC(0, 2, 1, 1).setFill(GBC.BOTH).setIpad(200, 10).setWeight(100, 0));
    }

    public MainStateBar getMainStateBar() {
        return mainStateBar;
    }

    public void setMainStateBarPanel(MainStateBar mainStateBar) {
        this.mainStateBar = mainStateBar;
    }

    public MainContentPanel getMainContentPanel() {
        return mainContentPanel;
    }

    public void setMainContentPanel(MainContentPanel mainContentPanel) {
        this.mainContentPanel = mainContentPanel;
    }
}
